//
//  SuggestedMVTableViewCell.m
//  wind
//
//  Created by dllo on 16/1/14.
//  Copyright © 2016年 李金明. All rights reserved.
//

#import "SuggestedMVTableViewCell.h"
#import "UIImageView+WebCache.h"

@interface SuggestedMVTableViewCell ()

@property (nonatomic, retain) UIImageView *pickV;
@property (nonatomic, retain) UIImageView *bulletV;

@end

@implementation SuggestedMVTableViewCell

- (void)dealloc
{
    [_imageV release];
    [_songName release];
    [_singerName release];
    [_pickCount release];
    [_bulletCount release];
    [_pickV release];
    [_bulletV release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createViews];
    }
    return self;
}

- (void)createViews
{
//    self.backgroundColor = [UIColor blueColor];
    
    self.imageV = [[UIImageView alloc] init];
//    self.imageV.backgroundColor = [UIColor blueColor];
    [self addSubview:self.imageV];
    [_imageV release];
    
    self.songName = [[UILabel alloc] init];
//    self.songName.backgroundColor = [UIColor redColor];
    [self addSubview:self.songName];
    [_songName release];
    
    self.singerName = [[UILabel alloc] init];
//    self.singerName.backgroundColor = [UIColor yellowColor];
    [self addSubview:self.singerName];
    [_singerName release];
    
    self.pickV = [[UIImageView alloc] init];
    self.pickV.image = [UIImage imageNamed:@"iconfont-font43"];
    [self addSubview:self.pickV];
    [_pickV release];
    
    self.pickCount = [[UILabel alloc] init];
//    self.pickCount.backgroundColor = [UIColor blueColor];
    [self addSubview:self.pickCount];
    [_pickCount release];
    
    self.bulletV = [[UIImageView alloc] init];
    self.bulletV.image = [UIImage imageNamed:@"iconfont-pinglun"];
    [self addSubview:self.bulletV];
    [_bulletV release];
    
    self.bulletCount = [[UILabel alloc] init];
//    self.bulletCount.backgroundColor = [UIColor blueColor];
    [self addSubview:self.bulletCount];
    [_bulletCount release];
    
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.imageV.frame = CGRectMake(5, 5, self.frame.size.width / 2, self.frame.size.height - 10);
    [self.songName mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.imageV.mas_right).with.offset(10);
        make.top.equalTo(self.imageV.mas_top);
        make.right.equalTo(self.mas_right).with.offset(-5);
        make.height.mas_equalTo(@40);
        
    }];
    
    [self.singerName mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.imageV.mas_right).with.offset(10);
        make.top.equalTo(self.songName.mas_bottom);
        make.right.equalTo(self.mas_right).with.offset(-5);
        make.height.mas_equalTo(@40);
        
    }];
    
    [self.pickV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.imageV.mas_right).with.offset(10);
        make.top.equalTo(self.singerName.mas_bottom).with.offset(5);
        make.width.mas_equalTo(@20);
        make.height.mas_equalTo(@20);
        
    }];
    
    [self.pickCount mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.pickV.mas_right).with.offset(10);
        make.top.equalTo(self.singerName.mas_bottom).with.offset(5);
        make.right.equalTo(self.mas_right).with.offset(-10);
        make.height.mas_equalTo(@20);
        
    }];
    
    [self.bulletV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.imageV.mas_right).with.offset(10);
        make.top.equalTo(self.pickV.mas_bottom).with.offset(15);
        make.width.mas_equalTo(@20);
        make.height.mas_equalTo(@20);
        
    }];
    
    [self.bulletCount mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.bulletV.mas_right).with.offset(10);
        make.top.equalTo(self.pickV.mas_bottom).with.offset(15);
        make.right.equalTo(self.mas_right).with.offset(-10);
        make.height.mas_equalTo(@20);
        
    }];
    
}

@end
